<html>

<head>

    <title>Help On LaTeX arrays</title>

    <link rel="stylesheet" type="text/css" title="Help with LaTeX" href="latex.css">

</head>

<body>


<h2>Arrays</h2>





<pre>

 \begin{array}[pos]{vvvv}

 column 1 entry &amp: column 2 entry ... &amp; column n entry \\

 ...

 ...

 ...

 \end{array}

</pre>


<p>The array environment, like the

    <a href="ltx-68.html">tabular</a> environment, produces a

    <a href="ltx-143.html">box</a> consisting of a sequence of rows

    of vertically aligned columns. It can be used only within the

    <a href="ltx-115.html">math environment</a>.</p>


<p>There is a single mandatory argument describing the number

    of columns and the alignment within each of them. Each of the

    <tt>v</tt>'s in the argument specifies a column and may be a

    <tt>l</tt>, <tt>c</tt>, or <tt>r</tt> indicating that the column

    should be flush left, centered, or flush right, respectively.

    For more complex options, see the <a

            href="ltx-68.html">tabular environment</a> which uses the same

    format.</p>


<p>The optional <tt>pos</tt> argument specifies the alignment of

    the array with its surrounding environment (recall that LaTeX

    treats boxes as one, albeit large letter). The options are</p>


<ul>

    <li><tt>t</tt> - align on top row</li>

    <li><tt>b</tt> - align on bottom row</li>

</ul>


<p>The default is to align on the center of the array.</p>


<p>Column entries must be separated by an <tt>&amp;</tt>.

    Column entries may include other LaTeX commands, even other

    arrays. Each row of the array must be terminated with the

    string <tt><a href="ltx-181.html">\\</a></tt>. Note that there

    is no <tt>&amp;</tt> after the last item in a row and no

    <tt>\\</tt> after the last row. (An exception is if an

    <tt><a href="ltx-239.html">\hline</a></tt> is used to place a

    line at the bottom; it follows a <tt>\\</tt>.)</p>


<p>Each item in the array is treated as if it were surrounded by

    braces. Thus, a <a href="declarations.html">declaration</a>

    within an array item is local to that item, i.e., it is ended by

    an <tt>&amp;</tt> or <tt>\\</tt>.</p>


<p>Horizontal and vertical lines in the array are produced with</p>


<ul>

    <li><tt><a href="ltx-214.html">\cline</a></tt></li>

    <li><tt><a href="ltx-239.html">\hline</a></tt></li>

    <li><tt><a href="ltx-346.html">\vline</a></tt></li>

</ul>

<hr noshade="noshade" size="1">


<p>See also </p>


<ul>

    <li><a href="ltx-68.html">tabular environment</a><br>

    <li><a href="ltx-115.html">math environment</a>

</ul>


</body>
</html>